package com.hurst

import org.joda.time.LocalDate

class WorkWeek {

    LocalDate startDate
    WorkDay monday    = new WorkDay()
    WorkDay tuesday   = new WorkDay()
    WorkDay wednesday = new WorkDay()
    WorkDay thursday  = new WorkDay()
    WorkDay friday    = new WorkDay()
    boolean managerAgreed = false


    static constraints = {
        monday nullable:true
        tuesday nullable:true
        wednesday nullable:true
        thursday nullable:true
        friday nullable:true
    }

    static transients = ['totalHours']

    def getTotalHours(){
        return monday.numOfHours + tuesday.numOfHours + wednesday.numOfHours + thursday.numOfHours + friday.numOfHours
    }
}
